home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ccccppppuuuusssseeeettttGGGGeeeettttPPPPIIIIDDDDLLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttPPPPIIIIDDDDLLLLiiiisssstttt((((3333xxxx))))
-
-
-
- NNNNAAAAMMMMEEEE
- cpusetGetPIDList - get a list of all PIDs attached to a cpuset
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>>
-
- ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt ****ccccppppuuuusssseeeettttGGGGeeeettttPPPPIIIIDDDDLLLLiiiisssstttt((((cccchhhhaaaarrrr ****qqqqnnnnaaaammmmeeee))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _c_p_u_s_e_t_G_e_t_P_I_D_L_i_s_t function is used to obtain a list of the PIDs for
- all processes currently attached to the specified cpuset. Only processes
- with a user ID or group ID that has read permissions on the permissions
- file can successfully execute this function.
-
- The qqqqnnnnaaaammmmeeee argument is the name of the cpuset to which the current process
- should be attached.
-
- The function returns a pointer to a structure of type ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt
- (defined in <cpuset.h>). The function _c_p_u_s_e_t_G_e_t_P_I_D_L_i_s_t allocates the
- memory for the structure and the user is responsible for freeing the
- memory using the function _c_p_u_s_e_t_F_r_e_e_P_I_D_L_i_s_t(3x). The ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt
- structure looks similar to this:
-
- typedef struct {
- int count;
- pid_t *list;
- } cpuset_PIDList_t;
-
-
- ccccoooouuuunnnntttt is the number of PID values in the list. lllliiiisssstttt references an array
- that holds the list of PID values. The memory for lllliiiisssstttt is allocated when
- the ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt is allocated and it is released when the
- ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt structure is released.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- This example obtains the list of PIDs attached to the cpuset mpi_set and
- prints out the PID values.
-
- char *qname = "mpi_set";
- cpuset_PIDList_t *pids;
-
- /* Get the list of PIDs else print error & exit */
- if ( !(pids = cpusetGetPIDList(qname)) ) {
- perror("cpusetGetPIDList");
- exit(1);
- }
- if (pids->count == 0) {
- printf("CPUSET[%s] has 0 processes attached\n",
- qname);
- } else {
- int i;
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- ccccppppuuuusssseeeettttGGGGeeeettttPPPPIIIIDDDDLLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttPPPPIIIIDDDDLLLLiiiisssstttt((((3333xxxx))))
-
-
-
- printf("CPUSET[%s] attached PIDs:\n",
- qname);
- for (i = 0; i < pids->count; i++)
- printf("PID[%d]0, pids->list[i]);
- }
- cpusetFreePIDList(pids);
-
-
- NNNNOOOOTTTTEEEESSSS
- _c_p_u_s_e_t_G_e_t_P_I_D_L_i_s_t is found in the library "libcpuset.so", and will be
- loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- cpuset(1), cpusetFreePIDList(3x), cpuset(5).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- If successful, _c_p_u_s_e_t_G_e_t_P_I_D_L_i_s_t returns a pointer to a ccccppppuuuusssseeeetttt____PPPPIIIIDDDDLLLLiiiisssstttt____tttt
- structure. If _c_p_u_s_e_t_G_e_t_P_I_D_L_i_s_t fails, it returns NULL and eeeerrrrrrrrnnnnoooo is set
- to indicate the error. The possible values for eeeerrrrrrrrnnnnoooo are the same as the
- values set by _s_y_s_m_p(2) and _s_b_r_k(2).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-